home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_sq21.zip
/
QDIAL.SLT
< prev
next >
Wrap
Text File
|
1992-03-20
|
8KB
|
226 lines
//-----------------------------------------------------------
// QDIAL.SL? Quick Dial or (if online) option setting.
//
// Hint: Define a softkey to trigger this file (use ALT-K).
// Please look at the comments through the whole file, and modify to
// suit your needs, BEFORE you use it. Then recompile with CS QDIAL.
//-----------------------------------------------------------
// If you have suggestions for improving this script, please suggest
// improvements to me via old-fashioned snail-mail to:
// Author: Inge Vabekk
// Hamangskogen 108
// N-1300 SANDVIKA
// NORWAY
// tel. (472) 546 396
str line [80]
,name [64]
,version []= "1234567890"
,display []= "DISPLAY" // Display script.
,getname []= "GETNAME" // Get Name script.
,global []= "GLOBAL"
,ring []= "RING" // Script to do the actual calling.
,exit []= "EXIT" // Name of EXIT script.
,ssl []= "SSL" // Name of SSL script.
,bbsname []= "BNAME" // Global for
,change []= "CHANGE" // Defined if status display changed.
,prompt []= "PROMPT" // Command prompt.
,logof []= "LOGOF" // Auto logoff Y/N
,start []= "STARTT" // Start time.
,startime [ 8] // Start time.
,temp [12] // Help string.
;
int sl;
//-----------------------------------------------------------
// Script starts here.
//-----------------------------------------------------------
main()
{
int i, col;
entry();
newdir (_telix_dir); // Make sure we're in the TELIX main directory.
if (!is_loaded(global)) // Global script not loaded:
{ if (call (getname,1)) // Call the GetName script.
{ tone (80,80); // No success:
clear_scr();
box (17,7,58,14,176,1,15);
box (19,8,56,13,177,1,15);
box (21,9,54,12,178,1,15);
pstraxy (" USER DATA OR SCRIPT NOT FOUND! ",22,10,79);
pstraxy (" Edit user data file and retry! ",22,11,79);
gotoxy (0,24);
i = -1;
goto quit;
}
getenv ("BBSNAME",name); // Get name of BBS to call.
if (name > " ") // Auto logoff if name given.
call (global,"W",logof,"YES");
else
call (global,"W",logof,"NO");
}
else
name = ""; // Not first time: Forget name.
call (global,"W",change,"NO");
call (display); // Update status.
keyset (0x1000,0,"@Logoff"); // Set the Alt-Q key.
// Get version number.
i = fopen("$SQUARE$.DAT","r");
if (i <= 0)
version="2.1α";
else
{ if (fgets(version,10,i) <= 0) // Read a line.
version="2.1α";
fclose(i); // Close the file again.
}
sl = 1 - (call (ssl))/24; // Starting line is 1 or 0
// (according to status line)
while (!name)
{ _back_color = 0;
_fore_color = 1;
col = _back_color*16 + _fore_color;
clear_scr();
pstraxy ("▓▓▓▓▓▓▓▓▒ ▓▓▓▓▓▓▓▓▒ ▓▓▒ ▓▓▒ ▓▓▓▒ ▓▓▓▒",1,sl+1,col);
pstraxy (" ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ",1,sl+2,col);
pstraxy (" ▓▓▒ ▓▓▓▓▓▓▒ ▓▓▒ ▓▓▒ ▓▓▓▓▓▒ ",1,sl+3,col);
pstraxy (" ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ",1,sl+4,col);
pstraxy (" ▓▓▒ ▓▓▓▓▓▓▓▓▒ ▓▓▓▓▓▓▓▓▒ ▓▓▒ ▓▓▓▒ ▓▓▓▒",1,sl+5,col);
pstraxy (" ▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒ ▒▒▒",1,sl+6,col);
pstraxy (" ▓▓▓▓▓▓▒ ▓▓▓▓▓▓▒ ▓▓▒ ▓▓▒ ▓▓▓▓▓▓▒ ▓▓▓▓▓▓▒ ▓▓▓▓▓▓▓▒",19,sl+18,col);
pstraxy ("▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ",19,sl+19,col);
pstraxy (" ▓▓▓▓▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▓▓▓▓▓▓▒ ▓▓▓▓▓▓▒ ▓▓▓▓▓▒ ",19,sl+20,col);
pstraxy (" ▓▓▒▓▓▒ ▓▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ",19,sl+21,col);
pstraxy (" ▓▓▓▓▓▓▒ ▓▓▓▓▓▒▓▓▒ ▓▓▓▓▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▒ ▓▓▓▓▓▓▓▒",19,sl+22,col);
pstraxy (" ▒▒▒▒▒▒ ▒▒▒▒▒ ▒▒ ▒▒▒▒▒▒ ▒▒ ▒▒ ▒▒ ▒▒ ▒▒▒▒▒▒▒",19,sl+23,col);
_back_color = 4;
_fore_color = 15;
col = _back_color*16 + _fore_color;
box (64,sl+1,75,sl+5,2,0,col);
box (4,sl+18,15,sl+22,2,0,col);
_back_color = 1;
_fore_color = 7;
col = _back_color*16 + _fore_color;
box (20,sl+7,63,sl+16,2,0,col);
box (18,sl+8,61,sl+15,2,0,col);
box (16,sl+9,59,sl+14,2,0,col);
col = _fore_color*16 + _back_color;
pstraxy ("Telix_Square version ",22,sl+8,col);
pstraxy (version,43,sl+8,col);
pstraxy ("by Inge Vabekk",44,sl+15,col);
pstraxy ("Type (part of) BBS name to dial or",21,sl+10,col);
pstraxy ("'@list' ('list' contains names) or",21,sl+11,col);
pstraxy ("'D' (alone) for dialing directory:",21,sl+12,col);
_back_color = 4;
_fore_color = 15;
col = _back_color*16 + _fore_color;
pstraxy (".........................",25,sl+13,col);
gotoxy(25,sl+13);
update_term();
gets(name,25); // Get the name.
for (i=strlen(name)-1; i>=0; --i)
{ if (subchr(name,i) > '.') break; // Strip off spaces.
setchr(name,i,0);
}
blue();
if (name=="D" || name=="d") // Dialing dir. requested?
{ _qdbar_on = 0; // So
dial ("",5,0); // display dialing directory.
i = 0; // Abort requested.
}
if (i < 1) goto quit; // Abort?
}
call (global,"W",bbsname,name); // Set name of BBS to call.
if (call (global,"R",start,startime) < 0) // Get start time.
{ if (getenv ("SQRTIME",startime)) // Get start time for calling.
{ _scr_chk_key = 0; // Check that time string is legal.
time (curtime(),temp); // Get the time.
i = subchr (temp,2); // Get time separator.
if (!isdigit(subchr(startime,0))) goto dcall;
if (!isdigit(subchr(startime,1))) goto dcall;
if (subchr(startime,2)!=i) goto dcall;
if (!isdigit(subchr(startime,3))) goto dcall;
if (!isdigit(subchr(startime,4))) goto dcall;
setchr(startime,5,i);
setchr(startime,6,0);
clear_scr();
box ( 8,6,60,14,2,0,15);
box (10,7,58,13,2,0,15);
box (12,8,56,12,2,0,15);
pstraxy (" Waiting till clock strikes 00:00:00 ... ",13,10,116);
pstraxy (startime,42,10,116);
do
{ time (curtime(),temp); // Get the time.
pstraxy (temp,30,11,113);
pstraxy ("",0,0,17);
delay(5); // Wait 1/2 sec.
if (inkey()==27) break;
setchr(temp,6,0);
} while (startime != temp); // Not ready yet?
call (global,"W",start,"!"); // No more timed start.
}
}
dcall:
call (ring,sl);
call (global,"R",exit,line);
if (strposi (line,"YES",0) >= 0)
exittelix (0,1); // Exit.
quit:
message(); // Write message,
keyset (0x1000,0,"@Qdial"); // Restore the Alt-Q key.
return (0);
}
//-----------------------------------------------------------
// This routine writes a string to the screen (in color).
//-----------------------------------------------------------
message ()
{ int lines;
lines = call (ssl);
pstraxy (" Alt-Q to quick-dial again. ",0,lines,15);
gotoxy (0,1-lines/24);
}
//-----------------------------------------------------------
// Routine to clear the screen.
//-----------------------------------------------------------
blue ()
{
entry();
clear_scr();
}
//-----------------------------------------------------------
// Routine to update colors and status bar.
//--------------------------------